#ifndef _AV_RBUF_H_
#define _AV_RBUF_H_

typedef enum
{
	FREAME_TYPE_P		= 0,//p frame
	FREAME_TYPE_I		= 1,//KEY frame
	FREAME_TYPE_AAC		= 2//audio frame
}ENUM_AV_FRAME_TYPE;

typedef struct _RBUF_AV_FRAME_INFO
{
	ENUM_AV_FRAME_TYPE 	frame_type;
	int					frame_len;
	unsigned int 		timestamp;
	char 				*pframe_addr;
}RBUF_AV_FRAME_INFO;

int av_rbuf_init();
int av_rbuf_get_video_data_info_size();
int av_rbuf_read_one_frame_video(RBUF_AV_FRAME_INFO *pInfoBuf, char *pout, int size);
int av_rbuf_write_one_frame(RBUF_AV_FRAME_INFO avinfo);
int av_rbuf_read_earliest_keyframe(RBUF_AV_FRAME_INFO *pInfoBuf, char *pout, int size);

int av_rbuf_destroy();

#endif//END _AV_RBUF_H_